import java.util.concurrent.atomic.AtomicInteger;

public class Test21 {
    public static void main(String[] args) {
        //使用原子类
        AtomicInteger num = new AtomicInteger(10);
        //相当于num++
        num.getAndIncrement();
        //相当于++num
        num.incrementAndGet();
        System.out.println(num);
    }
}
